// Array构造函数的方法

// isArray 用来判断某个变量是否是一个数组对象
var a = 10
var b = 'hello'
var c = []
var d = { name: 'zhangsan' }
console.log(Array.isArray(a));
console.log(Array.isArray(b));
console.log(Array.isArray(c));
console.log(Array.isArray(d));

// Array.from 将类数组对象或者可迭代对象转换为数组
var str = 'hello'
for (let key in str) {
    console.log(key, str[key]);
}
for (let i = 0; i < str.length; i++) {
    console.log(i, str[i]);
}
console.log(Array.from(str));

// Array.of 创建一个数组实例
var arr = Array.of(10)
var arr1 = new Array(10)
var arr2 = Array.of(10, 'hello', null)
console.log(arr);
console.log(arr1);
console.log(arr2);